package java_thinking.unit_14._14_2;

/**
 * @Description : 修改SweetShop.java 使每种类型对象的创建由命令参数控制，即如果命令行是java
 * SweetShop Candy 那么只有Candy对象被创建
 * @author: cww
 * @DateTime: 2019/3/27 19:57
 */
class Candy1 {
    static { System.out.println("Loading Candy"); }
}

class Gum1 {
    static { System.out.println("Loading Gum"); }
}

class Cookie1 {
    static { System.out.println("Loading Cookie"); }
}
public class E07 {
    static String[] args1 = {"java_thinking.unit_14._14_2.Gum1","java_thinking.unit_14._14_2.Cookie1"};
    public static void main(String[] args) {
        for (String arg : args1) {
            try {
                Class.forName(arg);
            } catch (ClassNotFoundException e) {
                System.out.println("找不到该类");
            }
        }
    }
}
